﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ControlStock.Dominio;
using ControlStock.Servicio;


namespace ControlStock
{
    public partial class AdministraDepositos : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["id_Usuario"] == null)
                Response.Redirect("index.aspx");
            DepositoServicio busqueda = new DepositoServicio();
            gvdepositos.DataSource = busqueda.Listar(Convert.ToString(Session["Tipo_Usuario"]));
            gvdepositos.DataBind();
        }

        protected void gvdepositos_SelectedIndexChanged(object sender, EventArgs e)
        {
          
        }

        protected void btnnuevo_Click(object sender, EventArgs e)
        {
            Response.Redirect("AltaModDepositos.aspx");
        }

        protected void gvdepositos_RowEditing(object sender, GridViewEditEventArgs e)
        {
            Response.Redirect("AltaModDepositos.aspx?id=" + gvdepositos.Rows[e.NewEditIndex].Cells[1].Text);
        }
    }
}
